﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DesignPattern.行为型模式.StrategyPattern
{
    public class PersonContext
    {
        private ITravelStrategy TraveStrategy;
        
        public PersonContext(ITravelStrategy aITravelStrategy)
        {
            TraveStrategy = aITravelStrategy;
        }


        public void SetTraveStrategy(ITravelStrategy aITravelStrategy)
        {
            TraveStrategy = aITravelStrategy;
        }



        public void Travel()
        {
            TraveStrategy.TravelAlgorithm();
        }
    }
}
